package employeeTask;
public class Demo {
	
	public static void main(String[] args) {
		
		Employee[] employees = {
								new Employee("Pesho"),
								new Employee("Gosho"),
								new Employee("Tosho"),
								new Employee("Maria"),
								new Employee("Penka") 
								};
		
		Task[] tasks = { 
						new Task("prane na charshafi", 3),
						 new Task("miene na chashi", 1),
						 new Task("tupane na kilimi", 4),
						 new Task("kupuvane na kartofi", 2),
						 new Task("mieni na poda", 3),
						 new Task("pechene na chushki", 6),
						 new Task("pisane na kod", 13),
						 new Task("chetene na knigi po Java", 22),
						 new Task("gledane na televiziq", 2),
						 new Task("belene na domati", 5),
						 new Task("miene na kolata", 1)
		};
		
		//adding tasks to allwork object
		AllWork allWork = new AllWork();
		for ( Task task : tasks ) 
			allWork.addTask(task);
		
		//setting allWork object to all employees
		Employee.setAllWork(allWork);
		
		int day = 1;
		while (!allWork.isAllWorkDone()) {
			System.out.println("Start working day " + day);
			
			employees[0].work(employees, 0);
			
			System.out.println("End of working day " + day);
			day++;
		}
		
	}
}
 